﻿using System.Collections.Generic;
using UnityEngine;
using WorldMapBase.Tile.Pool;

namespace WorldMapBase.Tile
{
    public class AdornObject : WorldObject
    {
        public Vector3 showPostion;
        public bool bHide = false;
        public int rotationInt = -1;
        public override void SetPosition(Vector3 position)
        {
            base.SetPosition(position);
            if (position.x >= 0)
            {
                showPostion = position;
                bHide = false;
            }
        }

        public void SetPosition2(Vector3 position)
        {
            showPostion = position;
            bHide = true;
            SetPosition(GlobalValue.INVISIBLE_POSITION);
        }

        public void UpdateAdornShow(bool bShow)
        {
            if (bHide == !bShow) return;
            bHide = !bShow;
            if (bHide)
            {
                SetPosition(GlobalValue.INVISIBLE_POSITION);
            }
            else
            {
                SetPosition(showPostion);
            }
        }

        public void SetRotationInt(int rotation)
        {
            rotationInt = rotation;
        }

        public int GetRotationInt()
        {
            return rotationInt;
        }

    }
}
